# 导入包
# import time
from time import sleep
from selenium import webdriver
# 打开浏览器-创建浏览器对象
from selenium.webdriver.common.by import By
# 打开浏览器
driver = webdriver.Chrome(executable_path='chromedriver.exe')
# 输入访问地址（URL）
driver.get("http://121.43.169.97:8848/pageA.html")

# driver = webdriver.Chrome()
# 放大浏览器
driver.maximize_window()

# 通过执行脚本输入用户名：admin；密码:123456；电话号码：18611111111；电子邮件：123@qq.com
driver.find_element(By.ID, "userA").send_keys("admin")
driver.find_element(By.CSS_SELECTOR, "[name='passwordA']").send_keys("123456")
driver.find_element(By.CSS_SELECTOR, ".telA").send_keys("18611111111")
driver.find_element(By.XPATH, "//p[4]/input").send_keys("123@qq.com")

# 间隔3秒，修改电话号码为：18600000000
sleep(3)
driver.find_element(By.CSS_SELECTOR, ".telA").clear()

# driver.find_element(By.CSS_SELECTOR, ".telA").send_keys("18600000000")
driver.find_element_by_css_selector(".telA").send_keys("18600000000")

# 间隔3秒，点击‘注册′按钮
sleep(3)
driver.find_element_by_css_selector("button").click()

# 间隔3秒，关关闭浏览
sleep(3)

# 退出浏览器
driver.quit()